package com.pega.eprescription.activity.asysntask;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;

import com.pega.eprescription.MainActivity;
import com.pega.eprescription.activity.EditDrug;
import com.pega.eprescription.config.Defines;
import com.pega.eprescription.database.manager.DatabaseManager;
import com.pega.eprescription.database.model.Prescription;

public class PreLoadForAppTask extends AsyncTask<Void, Void, Void> {

	private Context context;

	public PreLoadForAppTask(Context context) {
		this.context = context;
	}

	protected void onPreExecute() {
		super.onPreExecute();
	}

	protected Void doInBackground(Void... params) {

		try {
			
				Thread.sleep(Defines.SLEEP_TIME);
		}
		catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return null;

	}

	protected void onPostExecute(Void result) {
		Intent intent = new Intent(context, MainActivity.class);
		context.startActivity(intent);
		((Activity) context).finish();
		

	}
}
